#if !defined(_APP_BUFFER_H)
#define _APP_BUFFER_H

#include "log/log.h"
#include <stdlib.h>
#include <string.h>
#include <pthread.h>



typedef struct {
    char *data;
    int total_size;
    int len;
    int offset;
}Buffer;

//初始化缓冲区
Buffer *app_buffer_init(int size);
//释放缓冲区
void app_buffer_free(Buffer *buffer);
//向缓冲区写入数据
int app_buffer_write(Buffer *buffer, char *data, int len);
//读取缓冲区数据
int app_buffer_read(Buffer *buffer, char *rxbuffer, int len);

#endif // _APP_BUFFER_H
